﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Stertex.Service;
using Stertex.Repository;

namespace www.Stertex.com.Models
{
    public class ProfileFactory
    {
        public  UserProfile CreateProfile(string email){
            UserService service = new UserService();
            User user = service.GetByEmail(email);
            UserProfile profile = new UserProfile();

            if(user == null) return null;

            profile.Email = user.Email;
            profile.UserId = user.ID;
            return profile;
        }
        public static ProfileFactory Instance()
        {
            return new ProfileFactory();
        }
    }
}